﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ModularFixture.CApMFPlacementPointGridRow
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections;


namespace DnProcessSimulateCommands.ModularFixture;

internal class CApMFPlacementPointGridRow
{
  internal const string EXACT_STR = "Exact";
  internal const string STEP_STR = "Step";
  internal const string FREE_STR = "Free";
  internal const double DEFAULT_VALUE = 0.0;
  internal const double DEFAULT_MIN = -100.0;
  internal const double DEFAULT_MAX = 100.0;
  internal const double DEFAULT_STEP = 10.0;
  private double m_value;
  private double m_min;
  private double m_max;
  private double m_step;
  private PointType m_type;

  public CApMFPlacementPointGridRow(
    double value,
    double min,
    double max,
    double step,
    PointType type)
  {
    this.m_value = value;
    this.m_min = min;
    this.m_max = max;
    this.m_step = step;
    this.m_type = type;
  }

  public CApMFPlacementPointGridRow()
  {
    this.m_value = 0.0;
    this.m_min = -100.0;
    this.m_max = 100.0;
    this.m_step = 10.0;
    this.m_type = PointType.Exact;
  }

  internal static PointType GetTypeFromString(string typeStr)
  {
    PointType typeFromString = PointType.Exact;
    if (typeStr.Equals("Exact"))
      typeFromString = PointType.Exact;
    if (typeStr.Equals("Step"))
      typeFromString = PointType.Step;
    if (typeStr.Equals("Free"))
      typeFromString = PointType.Free;
    return typeFromString;
  }

  internal ArrayList ToArray()
  {
    ArrayList array = new ArrayList();
    switch (this.m_type)
    {
      case PointType.Exact:
        array.Add((object) "Exact");
        array.Add((object) this.m_value.ToString());
        break;
      case PointType.Step:
        array.Add((object) "Step");
        array.Add((object) this.m_min.ToString());
        array.Add((object) this.m_max.ToString());
        array.Add((object) this.m_step.ToString());
        break;
      case PointType.Free:
        array.Add((object) "Free");
        array.Add((object) this.m_min.ToString());
        array.Add((object) this.m_max.ToString());
        break;
    }
    return array;
  }

  public double Value
  {
    get => this.m_value;
    set => this.m_value = value;
  }

  public double Min
  {
    get => this.m_min;
    set => this.m_min = value;
  }

  public double Max
  {
    get => this.m_max;
    set => this.m_max = value;
  }

  public double Step
  {
    get => this.m_step;
    set => this.m_step = value;
  }

  public PointType Type
  {
    get => this.m_type;
    set => this.m_type = value;
  }
}
